<?php
/**
 * wmfl.cn version 5.0
 * -----------------------------------------------
 * @author sy <409014125@qq.com>
 * @link http://www.utuo88.com
 * @copyright 2014 Utuo Tech co.,Ltd
 */
namespace Agent\Model;
use Think\Model;
/**
 * 客户行为模型
 * @author huajie <banhuajie@163.com>
 */
class AgentModel extends Model {
	
	static $agentLevel = array(
			'0' => '一级代理商',
			'1' => '二级代理商',
			'2' => '三级代理商',
	);
	
	protected $_validate = array(
		array('name','require','代理商名称必须',self::MUST_VALIDATE),
		array('email','email','代理商Email格式不正确',self::EXISTS_VALIDATE),
		array('email','','代理商Email已经存在',self::EXISTS_VALIDATE, 'unique'),
		//array('tel', '/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|189[0-9]{8}$/', '手机格式不正确', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH), //手机格式不正确 
	);
	
	protected $_auto = array(
		array('begin_time', 'strtotime', self::MODEL_BOTH, 'function'),
		array('end_time', 'strtotime', self::MODEL_BOTH, 'function'),
	);
	
}